import request from '@/utils/request'

export function list(params) {
  return request({
    url: '/api/merchant-dashboard/v1/cameraman/team',
    method: 'get',
    params
  })
}
export function serverList(params) {
  return request({
    url: '/api/merchant-dashboard/v1/cameraman',
    method: 'get',
    params
  })
}
export function add(data) {
  return request({
    url: '/api/merchant-dashboard/v1/cameraman/team',
    method: 'post',
    data
  })
}
export function serveradd(data) {
  return request({
    url: '/api/merchant-dashboard/v1/cameraman',
    method: 'post',
    data
  })
}
export function update(data) {
  return request({
    url: `/api/merchant-dashboard/v1/cameraman/team/${data.id}`,
    method: 'put',
    data
  })
}
export function serverupdate(data) {
  return request({
    url: `/api/merchant-dashboard/v1/cameraman/${data.id}`,
    method: 'put',
    data
  })
}
export function detail(id) {
  return request({
    url: `/api/merchant-dashboard/v1/cameraman/team/${id}`,
    method: 'get',
    params: { id }
  })
}
export function serverdetail(id) {
  return request({
    url: `/api/merchant-dashboard/v1/cameraman/${id}`,
    method: 'get',
    params: { id }
  })
}
export function change(data) {
  const url = !data.status
    ? `/api/merchant-dashboard/v1/cameraman/${data.id}/resume`
    : `/api/merchant-dashboard/v1/cameraman/${data.id}/forbid`
  return request({
    url,
    method: 'patch'
  })
}
export function remove(id) {
  return request({
    url: `/api/merchant-dashboard/v1/cameraman/team/${id}`,
    method: 'delete',
    params: { id }
  })
}
export function removeServer(id) {
  return request({
    url: `/api/merchant-dashboard/v1/cameraman/${id}`,
    method: 'delete',
    params: { id }
  })
}
